/**
 * <copyright>
 * </copyright>
 *

 */
package org.eclipse.gittab.gitTabDsl.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.gittab.gitTabDsl.Fret;
import org.eclipse.gittab.gitTabDsl.GitTabDslPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Fret</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.eclipse.gittab.gitTabDsl.impl.FretImpl#getFret <em>Fret</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class FretImpl extends NoteWrapperImpl implements Fret
{
  /**
   * The default value of the '{@link #getFret() <em>Fret</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFret()
   * @generated
   * @ordered
   */
  protected static final int FRET_EDEFAULT = 0;

  /**
   * The cached value of the '{@link #getFret() <em>Fret</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getFret()
   * @generated
   * @ordered
   */
  protected int fret = FRET_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected FretImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return GitTabDslPackage.Literals.FRET;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public int getFret()
  {
    return fret;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setFret(int newFret)
  {
    int oldFret = fret;
    fret = newFret;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GitTabDslPackage.FRET__FRET, oldFret, fret));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case GitTabDslPackage.FRET__FRET:
        return getFret();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case GitTabDslPackage.FRET__FRET:
        setFret((Integer)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case GitTabDslPackage.FRET__FRET:
        setFret(FRET_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case GitTabDslPackage.FRET__FRET:
        return fret != FRET_EDEFAULT;
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (fret: ");
    result.append(fret);
    result.append(')');
    return result.toString();
  }

} //FretImpl
